using System;
using CosyTrade.Organization;
using CosyTrade.Security;

namespace CosyTrade.UI
{
    public class GlobalInfo : IGlobalInfo
    {
        public static GlobalInfo Instance;

        private readonly Employee currentEmployee;
        private readonly Guid currentSession;

        public static void CreateInstance(Guid session, Employee employee)
        {
            Instance = new GlobalInfo(session, employee);
        }

        public GlobalInfo(Guid currentSession, Employee currentEmployee)
        {
            this.currentSession = currentSession;
            this.currentEmployee = currentEmployee;
        }
        
        public Employee CurrentEmployee
        {
            get { return currentEmployee; }
        }

        public Company CurrentCompany
        {
            get { return currentEmployee.OnCompany; }
        }

        public Role CurrentRole
        {
            get { return currentEmployee.MaptoRole; }
        }

        public Guid CurrentSession
        {
            get { return currentSession; }
        }
    }
}